
#import "UDMOctogris_UIFactory.h"

//====================================================================================
@implementation UDMOctogris_UIFactory

//====================================================================================
- (unsigned) interfaceVersion
{
	return 0;
}

//====================================================================================
- (NSString *) description
{
	return [NSString stringWithString:@"Octogris View"];
}

//====================================================================================
- (NSView *)uiViewForAudioUnit:(AudioUnit)inAU withSize:(NSSize)inPreferredSize
{
	if (![NSBundle loadNibNamed: @"UDMOctogris_CocoaUI" owner:self])
	{
        NSLog (@"Unable to load nib for view.");
		return nil;
	}

    [mUI setAU:inAU];
    
    NSView *returnView = mUI;
    mUI = nil;
	
	/*
	NSLog(@"preferredSize: %fx%f returnedSize: %fx%f",
			inPreferredSize.width, inPreferredSize.height,
			[returnView bounds].size.width, [returnView bounds].size.height); 
	*/
	
    return [returnView autorelease];
}

@end
